#!/usr/bin/env python

import comm_pyevent as comm, socket, struct, time

def hook(msg, sender):
    print 'clnt rcvd:', len(msg), sender
    comm.stop()
    print 'aaaa'


comm.init(hook, 10062)

#comm.timer('xxx', 5)

for i in xrange(5):
    comm.send('hello', '127.0.0.1:10061')

comm.start()
print comm.peers
